﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ShowDashBoard.aspx.cs"
    Inherits="Actuals.DashBoard" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Show Dashboard</title>
    <link href="~/Actuals.css" rel="stylesheet" type="text/css" />
    
    <link href="~/themes/ui-lightness/jquery.ui.all.css" rel="stylesheet" type="text/css" />
     <script type="text/javascript" src="<%= ResolveUrl("~/Scripts/jquery.js") %>"></script>
    <script type="text/javascript" src="<%= ResolveUrl("~/Scripts/jquery.ui.datepicker.js") %>"></script>
    <script type="text/javascript" src="<%= ResolveUrl("~/Scripts/jquery.ui.core.js") %>"></script>
     <script type="text/javascript">
         $(document).ready(function () {
             $("#<%=txtDbAsOfDate.ClientID %>").datepicker({ dateFormat: 'mm-dd-yy', changeMonth: true, changeYear: true, yearRange: '2011:2013' });

         });

         function ShowUpdateAddTasks(taskId) {

             var url = 'AddTasks.aspx?Mode=Edit&TaskId=' + taskId;


             var result = window.showModalDialog(url, this,
                'dialogHeight:400px;dialogWidth:400px;Status:yes;Toolbars:no;Scroll:yes;Help:no;Center:yes;');
             __doPostBack('refresh', 'refresh');
         }

    </script>
</head>
<body>
    <form id="form1" runat="server">

    <center>
      
        <div>
            <asp:Label ID="Label2" runat="server" CssClass="ParaTitle">Dashboard </asp:Label>
        </div>
        <div>
            <table>
               <tr>
                            <td>
                                <asp:Label ID="Label7" runat="server" CssClass="label">Project</asp:Label>
                            </td>
                            <td align="left">
                                <asp:DropDownList ID="ddlProject" runat="server" CssClass="textfield" AutoPostBack="true"
                                    OnSelectedIndexChanged="ddlProject_OnSelectedIndexChanged">
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="Label8" runat="server" CssClass="label">Release</asp:Label>
                            </td>
                            <td align="left">
                                <asp:DropDownList ID="ddlRelease" runat="server" CssClass="textfield " AutoPostBack="true" 
                                OnSelectedIndexChanged="ddlRelease_OnSelectedIndexChanged" >
                                </asp:DropDownList>
                            </td>
                        </tr>

                <tr>
                    <td> 
                     <asp:Label ID="Label5" runat="server" CssClass="label">Show Dashboard as of </asp:Label>
                    </td>
                    <td>
                        <asp:TextBox ID="txtDbAsOfDate" runat="server" CssClass="textfield"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="Label1" runat="server" CssClass="label">Project </asp:Label>
                    </td>
                    <td>
                        <asp:Label ID="lblProject" runat="server" CssClass="textfield"> </asp:Label>
                    </td>
              
                    <td>
                        <asp:Label ID="Label3" runat="server" CssClass="label">Release </asp:Label>
                    </td>
                    <td>
                        <asp:Label ID="lblRelease" runat="server" CssClass="textfield"> </asp:Label>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="Label4" runat="server" CssClass="label">StartDate </asp:Label>
                    </td>
                    <td>
                        <asp:Label ID="lblStartDate" runat="server" CssClass="textfield"> </asp:Label>
                    </td>
               
                    <td>
                        <asp:Label ID="Label6" runat="server" CssClass="label">EndDate </asp:Label>
                    </td>
                    <td>                        
                        <asp:Label ID="lblEndDate" CssClass="label"  runat="server"></asp:Label>                                             
                        <asp:Button ID="btnGetDashboard" runat="server" Text="Get Dashboard" OnClick="btnGetDashboard_OnClick" />
                    </td>

                </tr>
            </table>
        </div>
        <div runat="server" id="divControls">
            <div id="divGrid" style="border: solid 1px silver; height: 600px;  text-align: center;
                overflow-x: hidden; overflow-y: auto;">
                <asp:GridView ID="gvDashBoard" AutoGenerateColumns="false" BorderColor="Black" runat="server"
                    AllowPaging="false" AllowSorting="true" OnRowDataBound="gvDashBoard_RowDataBound"
                    ShowFooter="true" OnRowCommand="gvDashBoard_OnRowCommand">
                    <HeaderStyle BackColor="White" Font-Size="10px" ForeColor="#990000" BorderStyle="None" />
                    <RowStyle BackColor="#F7F3F7" Font-Names="Verdana" Font-Size="XX-Small" BorderStyle="None" />
                    <AlternatingRowStyle BackColor="White" Font-Names="Verdana" Font-Size="XX-Small"
                        BorderStyle="None" />
                    <FooterStyle BackColor="Goldenrod" Font-Names="Verdana" Font-Size="XX-Small" BorderStyle="None" />
                    <Columns>
                     <asp:TemplateField HeaderStyle-Width="5%" ItemStyle-Width="5%" ItemStyle-BorderStyle="None"
                            HeaderStyle-BorderStyle="None">
                            <ItemTemplate>
                                <asp:Button CausesValidation="false" CommandName="EditActual" runat="server" ID="btnEdit"
                                    Text="Edit" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "TaskId") %>'  />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="TaskType" HeaderText="TaskType" SortExpression="TaskType" />                       

                        <asp:BoundField DataField="TaskShortName" HeaderText="Task Short Name" SortExpression="TaskShortName">
                        </asp:BoundField>
                         <asp:BoundField DataField="Priority" HeaderText="Priority" SortExpression="Priority">
                        </asp:BoundField>
                        <asp:BoundField DataField="Description" HeaderText="Description" SortExpression="Description">
                        </asp:BoundField>
                        <asp:TemplateField HeaderText="TaskStatus">
                            <ItemTemplate>
                                <asp:Label ID="lblTaskStatus" runat="server" Text='<%# getTaskStatusDescription(Eval("Status")) %>' />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="InitialEstimation" HeaderText="Initial Estimation" SortExpression="InitialEstimation">
                            <ItemStyle HorizontalAlign="Right" />
                            <FooterStyle HorizontalAlign="Right" />
                        </asp:BoundField>
                        <asp:BoundField DataField="CurrentEstimation" HeaderText="Current Estimation" SortExpression="CurrentEstimation">
                            <ItemStyle HorizontalAlign="Right" />
                            <FooterStyle HorizontalAlign="Right" />
                        </asp:BoundField>
                        <asp:BoundField DataField="Elapsed" HeaderText="Elapsed" SortExpression="Elapsed">
                            <ItemStyle HorizontalAlign="Right" />
                            <FooterStyle HorizontalAlign="Right" />
                        </asp:BoundField>
                        <asp:BoundField DataField="Remaining" HeaderText="Remaining" SortExpression="Remaining">
                            <ItemStyle HorizontalAlign="Right" />
                            <FooterStyle HorizontalAlign="Right" />
                        </asp:BoundField>
                        <asp:TemplateField HeaderStyle-Width="5%" ItemStyle-Width="5%" ItemStyle-BorderStyle="None"
                            HeaderStyle-BorderStyle="None">
                            <HeaderStyle BackColor="White" Font-Size="10px" ForeColor="#990000" BorderColor="Black"
                                BorderStyle="None" />
                            <ItemStyle BackColor="#F7F3F7" Font-Names="Verdana" Font-Size="XX-Small" BorderStyle="None" />
                            <FooterStyle BackColor="Goldenrod" Font-Names="Verdana" Font-Size="XX-Small" BorderColor="Black"
                                BorderStyle="None" HorizontalAlign="Right" />
                            <HeaderTemplate>
                                <asp:Label ID="lblTotalRemaining" runat="server" Text="Total Remaining"></asp:Label>
                            </HeaderTemplate>
                            <ItemTemplate>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderStyle-Width="5%" ItemStyle-Width="5%" ItemStyle-BorderStyle="None"
                            HeaderStyle-BorderStyle="None">
                            <HeaderStyle BackColor="White" Font-Size="10px" ForeColor="#990000" BorderStyle="None" />
                            <ItemStyle BackColor="#F7F3F7" Font-Names="Verdana" Font-Size="XX-Small" BorderStyle="None" />
                            <FooterStyle BackColor="Goldenrod" Font-Names="Verdana" Font-Size="XX-Small" BorderStyle="None"
                                HorizontalAlign="Right" />
                            <HeaderTemplate>
                                <asp:Label ID="lblLagAdvance" runat="server" Text="Lag/Advance"></asp:Label>
                            </HeaderTemplate>
                            <ItemTemplate>
                            </ItemTemplate>
                        </asp:TemplateField>
                         
                    </Columns>
                </asp:GridView>
            </div>
        </div>
       
    </center>
    </form>
</body>
</html>
